<#include "/macro.include"/> <#assign className = table.className>
<#assign classNameLower = className?uncap_first> <#noparse> <#include
"../common/com.html"/> <@layout>
</#noparse>        	
   	
<!-- ace styles -->
<link rel="stylesheet" href="<@jspEl "ctx"/>/static/assets/css/ace.min.css" />

<script type="text/javascript">
    /**
     * 新增
     */
    function saveModel() {
        var id=document.getElementById("id").value;
              if(Validator.Validate(document.getElementById('form1'))){
        } else {
            return;
        }
        
        url = '';
        if(id==""){
            url = '<@jspEl "ctx"/>/${classNameLower}/save';
        }     else{
            url = '<@jspEl "ctx"/>/${classNameLower}/update';
        }
        $('#form1').form('submit', {
            url : url,
            onSubmit : function() {
                return $(this).form('validate');
            },
            success : function(data) {
                alert(data);
                window.location.href=' <@jspEl "ctx"/>/${classNameLower}';
            }
        });

    }
</script>
<div class="page-content">
<div class="row-fluid">
						<div class="span12">
                <form class="form-horizontal"  id="form1" method="post" >
                	<input type="hidden"  name="id" id="id"    >
								<#list table.notPkColumns as column> <#if !column.isTimeStampColumn &&
		!column.isRmColumn> 
								<div class="control-group">
									<label class="control-label">${column.remarks}:</label>
						<div class="controls"><#if column.isDateTimeColumn> <input
								id="${column.columnNameLower}" name="${column.columnNameLower}"
								type="text"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="Wdate" /> <#elseif
								column.isNumberColumn> <input id="${column.columnNameLower}"
								name="${column.columnNameLower}" type="text"
								class="easyui-numberbox"<#if
								column.isFloatColumn>data-options="precision:2"<#if
								!column.nullable>reqire="true" dataType="Require" msg="请输入${column.remarks}" </#if>   
								</#if>/> <#elseif
								column.columnNameLower=="qycode"> <input
								id="${column.columnNameLower}" name="${column.columnNameLower}"
								type="text" class="easyui-validatebox"
								<#if !column.nullable>reqire="true" dataType="Require" msg="请输入${column.remarks}"</#if>" />
								<#else> <input id="${column.columnNameLower}"
								name="${column.columnNameLower}" type="text"
								 <#if !column.nullable>dataType="Require" msg="请输入${column.remarks}" </#if> style="min-height: 24px;"  />
								</#if>
							</div>
								 	</div>
								</#if> </#list>

    
             </form>
        </div>
        	<div class="span12 center">
				<a  class="btn btn-info btn-small" onclick="saveModel()">确定
				<a href="#"  class="btn btn-danger btn-small bigger-110"  onclick="window.location.href=' <@jspEl "ctx"/>/${classNameLower}'"  >取消 </a>
		</div>
    </div>
</div>

    </body>
   
    <script>
    	 /**
    * 修改页面使用
    */
<#include "/macro.include"/> <#assign className = table.className>
<#assign classNameLower = className?uncap_first> <#noparse>
 <#list newlist as m>
</#noparse>    
     <#list table.notPkColumns as columns>
        document.getElementById("${columns.columnNameLower}").value  
        =  '<#include "/macro.include"/><#assign className = table.className>
        <#assign classNameLower = className?uncap_first><#noparse>$</#noparse>{(m.${columns.columnNameLower})!}';
    </#list>
<#include "/macro.include"/> <#assign className = table.className>
<#assign classNameLower = className?uncap_first> <#noparse>
</#list>
</#noparse>
    </script>
<#noparse> </@layout> </#noparse>
